package avicit.bdp.dcs.semistructure.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * 目录模板关联实体类(bdp_dcs_catalog_template)
 */
@ApiModel(value = "CatalogTemplateDTO", description = "bdp_dcs_catalog_template")
@Table(name = "bdp_dcs_catalog_template")
public class CatalogTemplateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 目录路径
     */
    @LogField
    @ApiModelProperty(value = "目录路径")
    @FieldRemark(column = "catalog_path", field = "catalogPath", name = "目录路径")
    @Column(name = "catalog_path")
    private String catalogPath;

    /**
     * 目录名称
     */
    @LogField
    @ApiModelProperty(value = "目录名称")
    @FieldRemark(column = "catalog_name", field = "catalogName", name = "目录名称")
    @Column(name = "catalog_name")
    private String catalogName;

    /**
     * 文件路径
     */
    @LogField
    @ApiModelProperty(value = "文件路径")
    @FieldRemark(column = "filePath", field = "filePath", name = "文件路径")
    @Column(name = "filePath")
    private String filePath;

    /**
     * 模板ID
     */
    @LogField
    @ApiModelProperty(value = "模板ID")
    @FieldRemark(column = "template_id", field = "templateId", name = "模板ID")
    @Column(name = "template_id")
    private String templateId;

    /**
     * 组织机构代码
     */
    @ApiModelProperty(value = "组织机构代码")
    @FieldRemark(column = "org_identity", field = "orgIdentity", name = "组织机构代码")
    @Column(name = "org_identity")
    private String orgIdentity;

    /**
     * 密级
     */
    @ApiModelProperty(value = "密级")
    @FieldRemark(column = "secret_level", field = "secretLevel", name = "密级")
    @Column(name = "secret_level")
    private String secretLevel;

    public CatalogTemplateDTO(Builder builder) {
        this.id = builder.id;
        this.catalogPath = builder.catalogPath;
        this.catalogName = builder.catalogName;
        this.filePath = builder.filePath;
        this.templateId = builder.templateId;
        this.orgIdentity = builder.orgIdentity;
        this.secretLevel = builder.secretLevel;
    }

    public CatalogTemplateDTO(){

    }

    public static Builder builder() {
        return new Builder();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getCatalogPath() {
        return catalogPath;
    }

    public void setCatalogPath(String catalogPath) {
        this.catalogPath = catalogPath;
    }

    public String getCatalogName() {
        return catalogName;
    }

    public void setCatalogName(String catalogName) {
        this.catalogName = catalogName;
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    @Override
    public String getOrgIdentity() {
        return orgIdentity;
    }

    @Override
    public void setOrgIdentity(String orgIdentity) {
        this.orgIdentity = orgIdentity;
    }

    @Override
    public String getSecretLevel() {
        return secretLevel;
    }

    @Override
    public void setSecretLevel(String secretLevel) {
        this.secretLevel = secretLevel;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "目录模板管理";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "目录模板";
        } else {
            return super.logTitle;
        }
    }

    @Override
    public String toString() {
        return "CatalogTemplateDTO{" +
                "id='" + id + '\'' +
                ", catalogPath='" + catalogPath + '\'' +
                ", catalogName='" + catalogName + '\'' +
                ", filePath='" + filePath + '\'' +
                ", templateId='" + templateId + '\'' +
                ", orgIdentity='" + orgIdentity + '\'' +
                ", secretLevel='" + secretLevel + '\'' +
                '}';
    }

    public static class Builder{
        private String id;
        private String catalogPath;
        private String catalogName;
        private String filePath;
        private String templateId;
        private String orgIdentity;
        private String secretLevel;

        public Builder id(String id) {
            this.id = id;
            return this;
        }
        public Builder catalogPath(String catalogPath) {
            this.catalogPath = catalogPath;
            return this;
        }
        public Builder catalogName(String catalogName) {
            this.catalogName = catalogName;
            return this;
        }
        public Builder filePath(String filePath) {
            this.filePath = filePath;
            return this;
        }
        public Builder templateId(String templateId) {
            this.templateId = templateId;
            return this;
        }
        public Builder orgIdentity(String orgIdentity) {
            this.orgIdentity = orgIdentity;
            return this;
        }
        public Builder secretLevel(String secretLevel) {
            this.secretLevel = secretLevel;
            return this;
        }
        public CatalogTemplateDTO build() {
            return new CatalogTemplateDTO(this);
        }
    }

}